package com.viphuli.app.tool.fragment;

import java.util.ArrayList;
import java.util.List;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.BaseAdapter;
import android.widget.ListView;
import butterknife.Bind;
import butterknife.OnClick;

import com.loopj.android.http.RequestParams;
import com.viphuli.app.tool.R;
import com.viphuli.app.tool.bean.part.AccountUser;
import com.viphuli.app.tool.common.AccessTokenKeeper;
import com.viphuli.app.tool.http.ApiRequest;

public class ArrangeActionUserFragment extends BaseProgressBottomDialogFragment {

	@Bind(R.id.id_listview)
	protected ListView listview;

	private BaseAdapter adapter;

	private List<AccountUser> list = new ArrayList<AccountUser>();

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		//无标题
		getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);

		return super.onCreateView(inflater, container, savedInstanceState);
	}

	@Override
	protected int obtainContentRes() {
		return R.layout.frag_dialog_arrange;
	}

	@Override
	protected void initParams() {

	}

	@Override
	protected void initView() {

	}

	@Override
	protected void initData() {

		AccessTokenKeeper tokenKeeper = AccessTokenKeeper.readAccessToken(getActivity());

		if (tokenKeeper.isLogin()) {

			RequestParams params = new RequestParams();
			params.put("circle_id", tokenKeeper.getUser().circleId());

			ApiRequest.arrangeCircleMembers.request(this, params);

		}

	}
	
	
	@OnClick(R.id.id_arrange_btn)
	public void clickBtn(){
		getDialog().dismiss();
	}

	public ListView getListview() {
		return listview;
	}

	public List<AccountUser> getList() {
		return list;
	}

	public void setAdapter(BaseAdapter adapter) {
		this.adapter = adapter;
	}

	public BaseAdapter getAdapter() {
		return adapter;
	}
	

}
